package com.sunday.common.validation.custom;

import org.apache.commons.lang3.ObjectUtils;

public interface IEnum<T> {

    /**
     * 获取绑定值
     */
    T getValue();

    /**
     * 获取对应枚举
     */
    IEnum<T> choose(final T value);

    /**
     * 是否不为空
     */
    default boolean isNotEmpty(final T value) {
        return ObjectUtils.isNotEmpty(choose(value));
    }

}
